using System;
using System.Collections.Generic;
using System.IO;

namespace ScottLane.VideoInbox.Sources
{
    /// <summary>
    /// A class that 
    /// </summary>
    public class RecordedTVSource : VideoSource
    {
        private const string RECORDEDTV_PATH = @"Z:\Media\Videos\TV\Recordings";

        public override void FindNewVideos()
        {
            DirectoryInfo recordedTVDirectory = new DirectoryInfo(RECORDEDTV_PATH);

            foreach (FileInfo recording in recordedTVDirectory.GetFiles("*.dvr-ms"))
            {
                //DvrmsMetadataEditor editor = new DvrmsMetadataEditor(recording.FullName);
                //IDictionary attributes = editor.GetAttributes();

                //Video video = new Video();
                //video.Uri = new Uri(recording.FullName);
                //video.Title = ((MetadataItem)attributes["Title"]).Value.ToString();
                //video.Episode = ((MetadataItem)attributes["WM/SubTitle"]).Value.ToString();
                //video.Description = ((MetadataItem)attributes["WM/SubTitleDescription"]).Value.ToString();
                //video.Category = ((MetadataItem)attributes["WM/Genre"]).Value.ToString();
                //video.Duration = (long)((MetadataItem)attributes["Duration"]).Value;    // todo - get int then convert
                //video.Author = ((MetadataItem)attributes["WM/MediaStationName"]).Value.ToString();
                //video.ParentalRating = ((MetadataItem)attributes["WM/ParentalRating"]).Value.ToString();

                //OnVideoFound(new VideoEventArgs(video));
            }
        }
    }
}
